
Current quorum_id: {{quorum_id}} <br>
Next quorum status: {{quorum_status}}

<h3>Previous Quorum</h3>
{% if let Some(prev_quorum) = prev_quorum %}

Previous quorum id: {{prev_quorum.quorum_id}} <br>
Num participants: {{num_participants}} <br>
Quorum age:
{{SystemTime::try_from(prev_quorum.created.unwrap()).unwrap().elapsed().unwrap().as_secs_f64()}}s

<div>
{% for member in prev_quorum.participants %}

<div class="member
 {% if member.step != max_step %}recovering{% endif %}
">
  <b>{{ member.replica_id }}</b> <br/>
  Step: {{ member.step }} <br/>
  Manager: {{ member.address }} <br/>
  TCPStore: {{ member.store_address }} <br/>
  World size: {{ member.world_size }} <br/>

  <button hx-post="/replica/{{member.replica_id}}/kill"
          hx-trigger="click">
    Kill
  </button>
</div>

{% endfor %}
</div>

{% endif %}

<h2>Heartbeats</h2>

<ul>
{% for replica_id in heartbeats.keys() %}

  {% let age = heartbeats[replica_id].elapsed().as_secs_f64() %}
  <li class="heartbeat
    {% if heartbeats[replica_id].lt(old_age_threshold) %}old{%endif%}
  ">
    {{ replica_id }}: seen {{ age }}s ago
  </li>

{% endfor %}
</ul>
